26HS

Technical details

Show code
library(GeoPressureR)
library(leaflet)
library(leaflet.extras)
library(raster)
library(dplyr)
library(ggplot2)
library(kableExtra)
library(plotly)
library(GeoLocTools)
setupGeolocation()
knitr::opts_chunk$set(echo = FALSE)
load(paste0("../data/1_pressure/", params$gdl_id, "_pressure_prob.Rdata"))
load(paste0("../data/2_light/", params$gdl_id, "_light_prob.Rdata"))
load(paste0("../data/3_static/", params$gdl_id, "_static_prob.Rdata"))
load(paste0("../data/4_basic_graph/", params$gdl_id, "_basic_graph.Rdata"))
load(paste0("../data/5_wind_graph/", params$gdl_id, "_wind_graph.Rdata"))
col <- rep(RColorBrewer::brewer.pal(8, "Dark2"), times = ceiling(max(pam$sta$sta_id) / 8))

Settings used

All the results produced here are generated with (1) the raw geolocator data, (2) the labeled files of pressure and light and (3) the parameters listed below.

Show code
kable(gpr) %>% scroll_box(width = "100%")
gdl_id keep crop_start crop_end thr_dur extent_N extent_W extent_S extent_E map_scale map_max_sample map_margin prob_map_s prob_map_s_calib prob_map_thr shift_k kernel_adjust calib_lon calib_lat calib_1_start calib_1_end calib_2_start calib_2_end calib_2_lon calib_2_lat prob_light_w thr_prob_percentile thr_gs thr_as RingNo scientific_name common_name mass wing_span Color sta_id_winter
26HS 9 2020-07-07 2021-06-23 0 51 -18 5 16 4 300 30 1 1.3 0.9 0 1.4 8.711702 46.55361 2020-07-07 2020-09-17 2021-05-13 2021-06-23 NA NA 0.09 0.95 120 100 N643031 Oenanthe oenanthe Northern wheatear NA NA #00CC96 17

Pressure timeserie

The labeling of pressure data is illustrated with this figure. The black dots indicates the pressure datapoint not considered in the matching. Each stationary period is illustrated by a different colored line.

Show code
pressure_na <- pam$pressure %>%
  mutate(obs = ifelse(isoutlier | sta_id == 0, NA, obs))
p <- ggplot() +
  geom_line(data = pam$pressure, aes(x = date, y = obs), colour = "grey") +
  # geom_point(data = subset(pam$pressure, isoutlier), aes(x = date, y = obs), colour = "black") +
  # geom_line(data = pressure_na, aes(x = date, y = obs, color = factor(sta_id)), size = 0.5) +
  geom_line(data = do.call("rbind", shortest_path_timeserie) %>% filter(sta_id > 0), aes(x = date, y = pressure0, col = factor(sta_id))) +
  theme_bw() +
  scale_colour_manual(values = col) +
  scale_y_continuous(name = "Pressure(hPa)")

ggplotly(p, dynamicTicks = T) %>% layout(showlegend = F)

Pressure calibration

Show code
pressure_ts_bind <- do.call("rbind", shortest_path_timeserie) %>%
  filter(!is.na(sta_id))

pam$pressure %>%
  left_join(pressure_ts_bind %>% dplyr::select(c("date", "pressure0")), by = "date") %>%
  mutate(diff = ifelse(is.na(pressure0), 0, obs - pressure0)) %>%
  filter(sta_id > 0 & !isoutlier) %>%
  group_by(sta_id) %>%
  mutate(sta_id = paste0(sta_id, " (SD=", round(sd(diff), 2), " ; N=", n(), ")")) %>%
  ggplot(aes(x = diff)) +
  geom_histogram(aes(y = (..count..) / tapply(..count.., ..PANEL.., sum)[..PANEL..]), binwidth = .2) +
  facet_wrap(~sta_id) +
  scale_x_continuous(name = "Pressure Geolocator - best match ERA5 (hPa)") +
  scale_y_continuous(name = "Normalized histogram")

Light

Show code
raw_geolight <- pam$light %>%
  transmute(
    Date = date,
    Light = obs
  )
lightImage(tagdata = raw_geolight, offset = 0)
tsimagePoints(twl$twilight,
  offset = 0, pch = 16, cex = 1.2,
  col = ifelse(twl$deleted, "grey20", ifelse(twl$rise, "firebrick", "cornflowerblue"))
)
abline(v = gpr$calib_2_start, lty = 1, col = "firebrick", lwd = 1.5)
abline(v = gpr$calib_1_start, lty = 1, col = "firebrick", lwd = 1.5)
abline(v = gpr$calib_2_end, lty = 2, col = "firebrick", lwd = 1.5)
abline(v = gpr$calib_1_end, lty = 2, col = "firebrick", lwd = 1.5)

Show code
hist(z, freq = F)
lines(fit_z, col = "red")

The probability map resulting from light data alone can be seen below.

Show code
li_s <- list()
l <- leaflet(width = "100%") %>%
  addProviderTiles(providers$Stamen.TerrainBackground) %>%
  addFullscreenControl()
for (i_r in seq_len(length(light_prob))) {
  i_s <- metadata(light_prob[[i_r]])$sta_id
  info <- pam$sta[pam$sta$sta_id == i_s, ]
  info_str <- paste0(i_s, " | ", info$start, "->", info$end)
  li_s <- append(li_s, info_str)
  l <- l %>% addRasterImage(light_prob[[i_r]], opacity = 0.8, colors = "OrRd", group = info_str)
}
l %>%
  addCircles(lng = gpr$calib_lon, lat = gpr$calib_lat, color = "black", opacity = 1) %>%
  addLayersControl(
    overlayGroups = li_s,
    options = layersControlOptions(collapsed = FALSE)
  ) %>%
  hideGroup(tail(li_s, length(li_s) - 1))

Light vs Pressure

We can compare light and pressure location at long stationary stopover (>5 days). By assuming the best match of the pressure to be the truth, we can plot the histogram of the zenith angle and compare to the fit of kernel density at the calibration site.

Show code
 raw_geolight <- pam$light %>%
    transmute(
      Date = date,
      Light = obs
    )
 dur <- unlist(lapply(pressure_prob, function(x) difftime(metadata(x)$temporal_extent[2],metadata(x)$temporal_extent[1], units = "days" )))
  long_id <- which(dur>5)

  par(mfrow = c(2, 3))
  for (i_s in long_id){
    twl_fl <- twl %>%
      filter(!deleted) %>%
      filter(twilight>shortest_path_timeserie[[i_s]]$date[1] & twilight<tail(shortest_path_timeserie[[i_s]]$date,1))
    sun <-  solar(twl_fl$twilight)
    z_i <- refracted(zenith(sun, shortest_path_timeserie[[i_s]]$lon[1], shortest_path_timeserie[[i_s]]$lat[1]))
    hist(z_i, freq = F, main = paste0("sta_id=",i_s, " | ",nrow(twl_fl),"twls"))
    lines(fit_z, col = "red")
    xlab("Zenith angle")
  }

Similarly, we can plot the line of sunrise/sunset at the best match of pressure (yellow line) and compare to the raw and labeled light data.

Show code
  lightImage(
    tagdata = raw_geolight,
    offset = gpr$shift_k / 60 / 60
  )
  tsimagePoints(twl$twilight,
                offset = gpr$shift_k / 60 / 60, pch = 16, cex = 1.2,
                col = ifelse(twl$deleted, "grey20", ifelse(twl$rise, "firebrick", "cornflowerblue"))
  )
  for (ts in shortest_path_timeserie){
    twl_fl <- twl %>%
      filter(twilight>ts$date[1] & twilight<tail(ts$date,1))
    if (nrow(twl_fl)>0){
    tsimageDeploymentLines(twl_fl$twilight,
                           lon = ts$lon[1], ts$lat[1],
                           offset = gpr$shift_k / 60 / 60, lwd = 3,col = adjustcolor("orange", alpha.f = 0.5))
      
    }
  }

Stationay period information

Show code
read_csv(paste0("../reports/figure_print/table_transition/transition_", params$gdl_id, ".csv")) %>% kable() %>% scroll_box(width = "100%")
…1 sta_id_s sta_id_t flight_duration as_m as_s gs_m gs_s ws_m ws_s dist_m dist_s ws_m_support ws_m_drift start_flight end_flight sunrise sunset as_sp gs_sp ws_sp dist_sp ws_sp_support ws_sp_drift alt_min alt_max alt_mean alt_med alt_sumdabsdiff alt_sumposdiff gdl_id
1 1 2 5.0 30.68453 13.057935 34.27395 16.489093 9.773649 3.9684847 171.36977 82.44547 4.7950044 8.516581 2020-09-16 18:00:00 2020-09-16 23:00:00 2020-09-17 04:43:48 2020-09-16 18:04:51 40.475859 50.235248 9.7759244 251.17624 9.7626044 0.5101507 2145.36853 3675.8771 2878.5442 2930.5410 3490.70038 2186.46459 26HS
2 2 3 9.5 50.93235 14.697238 45.94727 13.716450 21.291360 3.2780803 436.49903 130.30628 -0.3224493 21.288919 2020-09-23 18:00:00 2020-09-24 03:30:00 2020-09-24 04:47:23 2020-09-23 17:55:34 37.655174 31.912997 24.0638840 303.17347 2.8138656 23.8988007 182.42052 4156.9358 2158.0049 1979.0038 10619.47043 4018.23933 26HS
3 3 4 0.5 33.47795 17.753396 26.88436 24.556953 17.036418 8.9409271 13.44218 12.27848 -2.0042238 16.918116 2020-09-24 18:30:00 2020-09-24 19:00:00 2020-09-25 04:48:28 2020-09-24 17:46:36 30.557938 0.000000 30.5579381 0.00000 NA NA 161.53503 701.1886 431.3618 431.3618 539.65361 0.00000 26HS
4 4 5 2.5 37.61044 11.982804 31.08804 27.255077 40.104694 9.5319156 77.72011 68.13769 18.6616376 35.498307 2020-09-26 18:00:00 2020-09-26 20:30:00 2020-09-27 04:48:45 2020-09-26 17:43:05 28.361540 27.732780 46.8426302 69.33195 38.9243727 26.0600310 173.99063 1655.7513 856.7018 828.1485 2938.99780 1481.76063 26HS
5 5 6 3.5 37.32223 12.080094 32.74864 16.944841 25.657295 6.2779527 114.62023 59.30694 5.1577912 25.133523 2020-09-27 18:00:00 2020-09-27 21:30:00 2020-09-28 04:50:00 2020-09-27 17:39:13 36.306794 31.730380 31.2195965 111.05633 10.4520798 29.4179746 52.06013 883.7063 432.9185 357.4654 2473.09579 1330.52256 26HS
6 6 7 2.0 32.79936 15.873912 29.61778 17.650908 27.398114 7.2092817 59.23556 35.30182 9.3199336 25.764229 2020-09-28 19:30:00 2020-09-28 21:30:00 2020-09-29 04:50:05 2020-09-28 17:37:18 26.723365 29.720904 18.0493557 59.44181 8.3270203 16.0137433 248.62151 657.9249 477.8610 547.5233 861.70503 591.49222 26HS
7 7 8 3.5 27.73450 15.820647 28.36423 15.424889 8.670571 2.7852397 99.27480 53.98711 1.9479751 8.448916 2020-09-29 18:00:00 2020-09-29 21:30:00 2020-09-30 04:54:09 2020-09-29 17:34:35 28.874010 30.055443 8.0760419 105.19405 2.2432481 7.7582402 513.35069 1221.3426 850.0072 767.4263 1784.17418 816.78713 26HS
8 8 9 1.0 33.16928 13.335200 31.71603 14.648592 6.242437 2.2755773 31.71603 14.64859 -0.8722142 6.181202 2020-09-30 03:00:00 2020-09-30 04:00:00 2020-09-30 04:54:10 2020-09-29 17:37:29 24.446279 27.755064 3.7998255 27.75506 3.3716679 1.7522928 65.18733 541.2896 326.7750 373.8480 643.54391 476.10227 26HS
9 9 10 7.0 58.80838 10.475791 56.62167 10.670219 21.674121 1.5206606 396.35169 74.69154 1.9193647 21.588969 2020-09-30 19:30:00 2020-10-01 02:30:00 2020-10-01 04:53:12 2020-09-30 17:35:52 42.367252 44.055733 24.2573937 308.39013 8.3342699 22.7807176 437.86971 2016.4987 1270.0855 1331.0905 5402.50467 2970.67348 26HS
10 10 11 1.5 34.43752 15.753038 33.23832 15.090890 10.681243 2.5198230 49.85748 22.63634 0.4953949 10.669749 2020-10-01 21:30:00 2020-10-01 23:00:00 2020-10-02 04:53:00 2020-10-01 17:32:15 24.821372 23.799505 13.4161764 35.69926 2.7376564 13.1338885 832.82805 1545.4755 1191.0610 1192.9703 1397.83367 685.18619 26HS
11 11 12 2.0 30.13985 12.838914 34.97254 19.986021 30.696724 5.2308107 69.94508 39.97204 17.9706294 24.886649 2020-10-02 22:00:00 2020-10-03 00:00:00 2020-10-03 04:53:49 2020-10-02 17:29:49 29.537018 0.000000 29.5370185 0.00000 NA NA 655.07844 1519.1441 960.1921 860.9651 1654.05146 789.98585 26HS
12 12 13 12.5 41.27070 5.672056 47.92295 7.453933 12.239815 1.4959794 599.03686 93.17416 7.7536101 9.470724 2020-10-27 17:00:00 2020-10-28 05:30:00 2020-10-28 05:19:37 2020-10-27 16:57:47 41.769203 52.223457 11.3892241 652.79321 10.6497886 4.0368837 202.51010 2142.5083 1292.6665 1287.6847 7851.49337 3702.53657 26HS
13 13 14 12.0 44.35932 15.404116 55.19306 13.754062 20.642114 4.0997116 662.31674 165.04875 13.6305318 15.501789 2020-10-28 17:30:00 2020-10-29 05:30:00 2020-10-29 05:22:39 2020-10-28 17:12:24 35.408606 46.140757 17.5462718 553.68909 12.8202468 11.9796880 384.64443 1818.8299 1040.6961 830.3677 4449.55500 2264.72563 26HS
14 14 15 12.0 41.40153 12.776006 41.96911 14.108651 8.749411 5.6342762 503.62927 169.30381 1.4757404 8.624058 2020-10-29 17:30:00 2020-10-30 05:30:00 2020-10-30 05:21:50 2020-10-29 17:23:18 39.264987 42.018904 2.8186467 504.22685 2.7582095 0.5805597 645.36691 3416.9216 2190.2800 2496.0592 10543.40377 5256.02852 26HS
15 15 16 10.5 49.93632 14.235096 54.49087 15.323178 27.080750 4.5168518 572.15410 160.89337 11.0934706 24.704290 2020-10-30 18:00:00 2020-10-31 04:30:00 2020-10-31 05:22:08 2020-10-30 17:30:05 37.715803 45.909781 31.3797516 482.05270 18.1869196 25.5719527 417.99883 3573.4794 2435.0022 2902.8339 9077.41643 4384.91392 26HS
16 16 17 8.0 29.84593 12.607196 32.80054 13.240570 14.897625 2.3041339 262.40430 105.92456 6.2046972 13.544038 2020-11-02 19:30:00 2020-11-03 03:30:00 2020-11-03 05:23:36 2020-11-02 17:36:59 33.453763 36.008410 12.6522586 288.06728 4.6868356 11.7521580 315.72103 3595.6435 1368.7433 564.5900 7044.45501 3514.51539 26HS
17 17 18 10.5 55.83339 17.374159 56.80418 18.796785 6.154717 1.6038458 596.44392 197.36624 1.2959291 6.016736 2021-04-04 19:00:00 2021-04-05 05:30:00 2021-04-05 05:21:27 2021-04-04 18:23:34 40.793946 40.251618 8.5085744 422.64199 0.3533094 8.5012358 293.51433 2634.5002 1421.5940 1277.2729 5432.05089 2820.83394 26HS
18 18 19 11.0 39.25608 16.227342 47.51058 19.182978 19.641870 4.8476025 522.61638 211.01275 11.5976103 15.852398 2021-04-05 18:30:00 2021-04-06 05:30:00 2021-04-06 05:12:07 2021-04-05 18:29:03 38.213411 51.694704 18.1790719 568.64174 14.9198675 10.3863471 492.91829 3724.6037 2020.9953 1857.0626 7873.16386 3927.77960 26HS
19 19 20 13.5 46.33745 15.001549 69.63609 16.937205 28.613224 3.9403537 940.08723 228.65226 25.2795822 13.403706 2021-04-06 18:00:00 2021-04-07 07:30:00 2021-04-07 04:52:23 2021-04-06 18:27:55 39.664784 67.301616 30.2635452 908.57181 28.7667281 9.3998681 137.20625 3513.2854 2308.1576 2692.3910 10733.86277 5194.73413 26HS
20 20 21 10.5 34.98357 9.093269 38.01874 8.527951 13.590623 3.6916577 399.19672 89.54348 5.3431479 12.496231 2021-04-07 18:30:00 2021-04-08 05:00:00 2021-04-08 04:41:07 2021-04-07 18:23:15 32.879038 41.796460 13.1206275 438.86283 10.0255353 8.4640125 148.76157 1622.8113 913.7134 868.0826 8148.23017 4347.58972 26HS
21 21 22 10.0 51.50391 17.664230 75.56629 17.081416 30.221659 5.6573888 755.66285 170.81416 26.2746795 14.932845 2021-04-21 18:30:00 2021-04-22 04:30:00 2021-04-22 04:04:04 2021-04-21 18:33:08 44.378938 68.348751 30.8041555 683.48751 26.7082980 15.3480558 -61.97558 3240.2702 2059.4978 2125.2005 13359.12280 6100.41251 26HS
22 22 23 9.5 53.26688 17.398287 49.03497 17.393884 11.766234 2.9186766 465.83219 165.24190 -3.0028410 11.376607 2021-04-22 18:30:00 2021-04-23 04:00:00 2021-04-23 03:51:01 2021-04-22 18:38:39 50.332237 38.973753 15.4473525 370.25065 -9.9523381 11.8140452 21.86227 2411.6909 1074.5335 948.4245 7983.32058 4385.07987 26HS
23 23 24 4.0 37.56674 17.981122 36.51395 17.138402 7.690773 4.0110098 146.05581 68.55361 -0.2580294 7.686444 2021-04-23 19:00:00 2021-04-23 23:00:00 2021-04-24 03:47:44 2021-04-23 18:43:28 29.203140 28.220365 11.4761655 112.88146 1.3335758 11.3984187 113.87487 3281.7947 1170.7375 697.9754 5729.53980 2466.99454 26HS
24 24 25 1.5 35.18480 16.612404 34.55237 17.146072 3.918610 2.1908423 51.82856 25.71911 -0.4160085 3.896466 2021-04-24 03:30:00 2021-04-24 05:00:00 2021-04-24 03:46:24 2021-04-23 18:47:03 34.006954 37.046369 8.6760039 55.56955 3.9306629 7.7345286 -14.21649 907.7113 624.3152 801.8829 921.92783 921.92783 26HS
25 25 26 4.0 38.81664 15.729648 37.90035 16.162300 3.278319 1.4480667 151.60141 64.64920 -0.7855770 3.182804 2021-04-24 21:00:00 2021-04-25 01:00:00 2021-04-25 03:43:32 2021-04-24 18:49:47 25.746096 21.395799 4.4903547 85.58320 -4.3213613 1.2202960 495.29911 2367.3459 1434.5726 1456.5493 3753.75959 2518.77343 26HS
26 26 27 4.5 24.74204 11.306894 23.34843 11.824345 6.486769 1.9673419 105.06795 53.20955 -0.5341048 6.464743 2021-04-25 21:00:00 2021-04-26 01:30:00 2021-04-26 03:39:44 2021-04-25 18:54:21 6.108328 8.548688 5.8193917 38.46910 4.0727721 4.1566630 1829.07190 3395.3886 2583.0125 2570.7365 2789.38135 1023.80084 26HS
27 27 28 1.0 35.96975 18.073235 36.44787 18.791590 2.112522 2.1492833 36.44787 18.79159 0.5362060 2.043339 2021-05-01 18:30:00 2021-05-01 19:30:00 2021-05-02 03:30:23 2021-05-01 19:01:05 18.804455 19.234573 0.5369916 19.23457 0.4328052 0.3178673 1878.54269 1962.8200 1934.7276 1962.8200 84.27729 84.27729 26HS
28 28 29 1.5 34.85897 16.042749 33.45574 16.402458 6.315430 3.2035445 50.18361 24.60369 -0.8365755 6.259776 2021-05-08 22:30:00 2021-05-09 00:00:00 2021-05-09 03:21:15 2021-05-08 19:12:10 26.610900 25.646065 3.8336644 38.46910 -0.6964495 3.7698728 1896.77378 2529.5073 2172.3491 2131.5576 1056.59597 632.73348 26HS
29 29 30 1.0 37.82409 15.866114 37.18734 17.159937 10.181627 3.3185174 37.18734 17.15994 0.7516248 10.153846 2021-05-10 02:30:00 2021-05-10 03:30:00 2021-05-10 03:21:45 2021-05-09 19:15:35 37.767209 38.469098 8.1555646 38.46910 1.5599883 8.0049779 1256.28306 1935.9445 1489.0692 1274.9801 698.35840 18.69700 26HS
30 30 31 1.0 32.75175 13.849711 34.35887 16.455170 8.538680 4.8896547 34.35887 16.45517 2.6305321 8.123384 2021-05-10 22:00:00 2021-05-10 23:00:00 2021-05-11 03:21:17 2021-05-10 19:19:00 21.916812 19.234573 6.6598896 19.23457 -1.7162768 6.4349455 1149.83978 1347.5789 1249.7875 1251.9440 293.37399 197.73909 26HS
31 31 32 1.0 41.60002 15.073314 39.55006 15.234224 3.218772 0.4610956 39.55006 15.23422 -1.9721119 2.543868 2021-05-12 20:30:00 2021-05-12 21:30:00 2021-05-13 03:18:25 2021-05-12 19:22:48 37.185217 33.772434 3.6980422 33.77243 -3.3827522 1.4941567 1565.99822 1921.2420 1802.8274 1921.2420 355.24376 355.24376 26HS